
<p><b>syntax:</b> <i>proxy_cache_path path [levels=number] keys_zone=zone_name:zone_size [inactive=time] [max_size=size];</i>
</p><p><b>default:</b> <i>None</i>
</p><p><b>context:</b> <i>http</i>
</p><p>This directive sets the cache path and other cache parameters. Cached data stored in files. Key and filename in cache is md5 of proxied URL. <b>Levels</b> parameter set number of subdirectories in cache, for example for:
</p>
<pre class="code">  <span class="kw21">proxy_cache_path</span>  /data/nginx/cache  levels=<span class="nu0">1</span>:<span class="nu0">2</span>   keys_zone=one:10m;</pre>
<p>file names will be like:
</p><p>/data/nginx/cache/c/29/b7f54b2df7773722d382f4809d65029c
</p><p>All active keys and metadata stored in shared memory - zone, name and size of this zone defined in <b>keys_zone</b> parameter. If cached data not requested for time defined in <b>inactive</b> parameter, than data deleted. By default <b>inactive</b> is 10 minutes.
</p><p>Special process "cache manager" controls on-disk cache size, defined by parameter <b>max_size</b>, and when size exceed least used data deleted. 
</p><p>Zone size should be set proportional to number of pages to cache. Size of metadata for one page (file) depend on OS, currently it 64 bytes for FreeBSD/i386 and 128 bytes for FreeBSD/amd64. Keys in zone replaced by LRU when zone is full.
</p><p>proxy_cache_path and proxy_temp_path should be located on same filesyetem.
</p>
<br><i>Module: NginxHttpProxyModule</i>